﻿using Parylene_CVD.Model.DModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Parylene_CVD.DAL
{
    public class UserDAL : BaseDAL<User>
    {
        public List<User> GetAllUser()
        {
            return GetModelList("");
        }

        public List<User> GetUser(string strWhere, string strCols)
        {
            return GetModelList(strWhere, strCols, null);
        }

        public User getByUserName(string username)
        {
            return GetUserByUsername(username);
        }

        public int AddUser(User User, string strCols)
        {
            int a = Add(User, strCols, 0);
            return a;
        }

        public bool AddListUser(List<User> Users, string strCols)
        {
            bool a = AddList(Users, strCols);
            return a;
        }

        public bool UpdataUser(User User, string strCols)
        {
            return Update(User, strCols);
        }
        public bool UpdataUser(User User, string strCols, string strWhere)
        {
            return Update(User, strCols, strWhere, null);
        }
        public bool UpdataListUser(List<User> Users, string strCols)
        {
            return UpdateList(Users, strCols);
        }

        public bool DeleteUserByID(object id)
        {
            return Delete(id);
        }

        public bool DeleteUser(string strWhere)
        {
            return Delete(strWhere, null);
        }

        public bool DeleteListUserByID(List<object> idList)
        {
            return DeleteList(idList);
        }
    }
}
